// getting-started.js
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/shoushou');

var db = mongoose.connection;
db.on('error', console.error.bind(console, 'connection error:'));
db.once('open', function (callback) {
     console.log('数据库打开成功');
});

module.exports = db;

